package com.mark.flutterhybridandroid.utils;

import java.security.MessageDigest;

/**
 * @Desc
 * @作者 Mark
 * @时间 2019-05-08
 * @EMail 2285581945@qq.com
 */
public class Md5Utils {
    public static String md5Encode(String strContent) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            byte[] tempBytes = messageDigest.digest(strContent
                    .getBytes("UnicodeLittleUnmarked"));
            StringBuffer stringBuffer = new StringBuffer();
            for (byte bytes : tempBytes) {
                String tempByte = Integer.toHexString(bytes & 0xFF);
                stringBuffer.append(tempByte);
            }
            return stringBuffer.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
